package reflect;

import reflect.annotations.AutoRunClass;

import java.lang.reflect.Method;

public class ReflectDemo12 {
    public static void main(String[] args) throws Exception {

        Class cls = Class.forName("reflect.Person");

        Method method = cls.getDeclaredMethod("sayHello");
        Method method1 = cls.getDeclaredMethod("eat");
        boolean mark = method1.isAnnotationPresent(AutoRunClass.class);
        if (mark){
            System.out.println("被标注了!");
        }else {
            System.out.println("没有被标注");
        }
    }
}
